import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
import LayoutView from "../LayoutView.vue";


Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    // name: "lauout",
    component: LayoutView,
    children: [
      {
        path: "/",
        name: "home",
        component: () => import("../views/HomeView.vue"),
      },
    
      {
        path:'/newview',
        name:'newview',
        component: () => import("../views/NewView.vue"),
      },
      {
        path:'/classfiy',
        name:'classfiy',
        component: () => import("../views/ClassfiyView.vue"),
      },
      {
        path:'/mycenter',
        name:'mycenter',
        component: () => import("../views/MycenterView.vue"),
      }
    ],
    
  },
  {
    path:'/search',
    name:'search',
    component:()=> import("../views/SearchView.vue")
  },
  {
    path:'/active',
    name:'active',
    component:()=> import("../views/ActiveListView.vue")
  },
  {
    path:'/public',
    name:'public',
    component:()=> import("../views/PublicView.vue")
  },
  {
    path:'/foodetail',
    name:'foodetail',
    component:()=> import("../views/FoodetailView.vue")
  },
  {
    path: '*',
    name: 'error',
    component: () => import( '../views/ErrorView.vue')
  },
  
 
];

const router = new VueRouter({
  routes,
});

export default router;
